<template>
  <div id="wmsLifeInfo" style="overflow-y: auto">
    <el-timeline>
      <el-timeline-item v-for="(item,index) in lifeData" :key="index" :timestamp="item.lifeTime" placement="top">
        <el-card>
          <h4>{{ item.lifeType}}</h4>
          <p>{{ item.lifeDesc}}</p>
        </el-card>
      </el-timeline-item>
    </el-timeline>
  </div>
</template>

<script>
import * as axiosAPI from '@/api/wms/record.js';

export default {
  name: 'wmsLifeInfo',
  props: {
    // 物资台账id
    recordID: {
      type: String,
      default: null
    }
  },
  mounted() {
    this.initLifeData();
  },
  data() {
    return {
      lifeData:[]
    }
  },
  methods: {
    // 初始化查询物资台账生命周期记录
    initLifeData() {
      let _this = this;
      axiosAPI.getLifeList(_this.recordID)
        .then(function (res) {
          if (res.code == "0000") {
            _this.lifeData = res.data;
          }
        })
    }
  }
}
</script>

<style scoped>

</style>
